// Only modify this file to include
// - function definitions (prototypes)
// - include files
// - extern variable definitions
// In the appropriate section

#ifndef SVN_Helicopter_H_
#define SVN_Helicopter_H_
//add your includes for the project SVN_Helicopter here

#include "SVN_Helicopter.h"
#include "MI0283QT2/MI0283QT2.h"
#include "ADS7846/ADS7846.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdint.h>
#include <stdlib.h>
#include "Arduino.h"
#include "Nunchuck/WiiChuck.h"
#include "Files.h"
#include <TouchLib/TouchLib.h>
#include <stdio.h>

#define TP_EEPROMADDR (0x00) //eeprom address for calibration data

//end of add your includes here
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} // extern "C"
#endif

//add your function definitions for the project SVN_Helicopter here

typedef struct
{	uint8_t pos;
	uint8_t height;
} block;

typedef struct helicopter
{
	//location
	short int x;
	short int y;

	//size helicopter
	short int width;
	short int height;

	//current movement
	signed char movement;

} helicopter;

#define MAP_WITH 32
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240

Files * files;
MI0283QT2 lcd;
ADS7846 tp;
Touch touch(&lcd, &tp, 5);

uint8_t block_size = 10;
uint8_t _ArrayBlockIndex = 0;
uint8_t max_change = 1;
uint8_t init_height = 220;
uint8_t init_pos = 10;

block _Map[MAP_WITH];

unsigned int tcnt2 = 131;
int TicksFrames = 0;
int TicksUpdateShove = 0;

void DrawMenu();
void Update();
void UpdateBlockLocation();
void InitilizeDraw(block (* blocks)[32], MI0283QT2 * lcd);
void DrawMap(block * map, int mapStartIndex);
block GenerateNewBlock(block prevBlock);
void InitializeMap(block * map);

//Do not add code below this line
#endif /* SVN_Helicopter_H_ */
